#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
using namespace std;


int n, m, X, Y;
string s;
int f[1010][(1 << 5) + 10][(1 << 5) + 10]; 

void upd(int &x, int y) {
	x = (x + y) % mod;
}

signed main() {
	freopen("pearl.in", "r", stdin);
	freopen("pearl.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);

	cin >> n >> m >> X;
	cin >> s;
	int h = 1;
	for(int i = 0; i < m; i++) {
		Y += h * (s[i] - '0');
		h *= 2;
	}
	if(X == 1) f[1][Y][0] = 1;
	else {
		for(int i = 0; i < (1 << m); i++)
			f[1][i][0] = 1;
	}
	for(int i = 1; i < n; i++) {
		for(int j = 0; j < (1 << m); j++) {
			if(i == X && j != Y) continue;
			for(int S = 0; S < (1 << m); S++) {
				if(f[i][j][S] == 0) continue;
				for(int k = 0; k < (1 << m); k++) {
					upd(f[i + 1][k][S ^ (j * k) % h], f[i][j][S]);
				}
			} 
		}
	}
	int ans = 0;
	for(int j = 0; j < (1 << m); j++) {
		if(X == n && j != Y) continue;
		for(int S = 0; S < (1 << m); S++)
			upd(ans, f[n][j][S] * S % mod);
	}
	cout << ans;
	return 0;
}
/*
1 1 1
0
*/

